<?php
include_once './model/contactus.php';
class ContactUsController {
	public function invoke () {
		$contactus = new ModelContactUs();
		if (isset($_POST['NAMAPENGIRIM']) and isset($_POST['EMAILPENGIRIM'])and isset($_POST['JUDULCONTACTUS'])and isset($_POST['ISICONTACTUS'])) {
			$contact=$contactus->addContactUs('adib', $_POST['NAMAPENGIRIM'],$_POST['EMAILPENGIRIM'],$_POST['JUDULCONTACTUS'],$_POST['ISICONTACTUS']);
			if ($contact) {
				header("location:./view/list_contact_us.php");
			} else {
				header('location:./view/form_contact_us.php');
			}
		} 
	}
}